#ifndef _SYSDEFS_H
#define _SYSDEFS_H

#define _XOPEN_SOURCE
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>

#define CHAVE_FILA_SUBMIT_SCHEDULE 0x123
#define CHAVE_FILA_SCHEDULE_SUBMIT 0x888
#define CHAVE_FILA_LIST_SCHEDULE 0x321
#define CHAVE_FILA_SCHEDULE_LIST 0x999
#define CHAVE_FILA_SCHEDULE_SHUTDOWN 0x456

#define OK 1
#define NOT_OK 0

typedef enum {
	PENDING,
	RUNNING
} procState;

/*Estrutura contendo as informacoes dos processos*/
typedef struct _procInfo {

	long dummyLong;
	char programName[50];
	int argCount;
	char programArgs[10][20];
	int numProc;
	int execSeconds;
	int startTime;
	int nReq;
	int pidArray[10];
	procState state;

} procInfo;

/*Estrutura que o schedule usa para enviar a tabela de processos*/
typedef struct _procTable {
	long dummyLong;
	int numProcesses;
	procInfo procInfoArray[20];
} procTable;

/*Estrutura para mensagens de numero inteiro*/
typedef struct _intMsg{
	long dummyLong;
	int intMsg;
} intMsg;

#endif
